package com.software.graduationproject.commons.enums;

import com.v2coding.validate.BaseEnum;

/**
 * SysUserKind : 用户分类
 * ---------------------------------------------------------------------------------------------------------------------
 */
public enum SysUserType implements BaseEnum<SysUserType, Integer> {

    PLATFORM("平台用户", 0),
    // 租户用户
    TENANT("系统用户", 1),

    NORMAL("普通用户", 2),

    ERROR("数据错误", -1);

    private final String  label;
    private final Integer value;

    SysUserType(String label, Integer value) {
        this.label = label;
        this.value = value;
    }

    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String getLabel() {
        return this.label;
    }

    @Override
    public SysUserType getEnum(Integer value) {
        if (null == value) {
            return ERROR;
        }
        for (SysUserType e : values()) {
            if (e.value.equals(value)) {
                return e;
            }
        }
        return ERROR;
    }

}